﻿using System.Collections.Generic;
using System.Drawing;
using System.Linq;

namespace Engine.Result
{
    public class LotResult
    {
        private int _chipIndex = -1;
        private readonly List<ChipResult> _chipResults = new List<ChipResult>();

        /// <summary>
        /// 获取芯片测试结果
        /// </summary>
        /// <param name="id">"ref"</param>
        /// <returns></returns>
        public ChipResult GetChipResultById(object id)
        {
            return _chipResults.Find(r => r.Id.Equals(id));
        }

        //public bool NextPass(out ChipResult chip)
        //{
        //    _chipIndex++;
        //    chip = _chipResults.ElementAtOrDefault(_chipIndex);
        //    return chip != null;
        //}


        public ChipResult NextPass()
        {
            _chipIndex++;

            //  _chipResults.Remove(GetChipResultById(DUT));
            
            return _chipResults.ElementAtOrDefault(_chipIndex);


        }
        public void AddLotChip(DUTPoint dut)
        {
            _chipResults.Add(new ChipResult() { Id = dut });
        }




    }
}